package com.mva.common;

import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public abstract class DateUtils
  {
   public static Timestamp getTmstmp ()
	 {
	  GregorianCalendar now = new GregorianCalendar();
	  Date today            = now.getTime(); 
	  long nanos            = today.getTime();
	  Timestamp ts          = new Timestamp(nanos);
      return ts;
	 }

   public static String strDt (Date dt)
     {
	  String tmpDt = dt.toString();
      return tmpDt;
     }

   /*******************************************************************************
	  Returns today's date
	  <br><br>
	  @return Date - A <b><i>Date</i></b> variable
   *******************************************************************************/
   public static Date getToday()
     {
      GregorianCalendar dflt = new GregorianCalendar();
      dflt.set(Calendar.HOUR_OF_DAY,  0);
      dflt.set(Calendar.MINUTE,       0);
      dflt.set(Calendar.SECOND,       0);
      Date dt = (Date) dflt.getTime();
	  return dt;
     }
  }
